(function() {
    function removeChildren(elements){
        let parent;
        for(let el of elements){
            if (el){
                parent = el.parentElement;
                parent.removeChild(el);
            }
        }
    }
    for(let tagName of ['header', 'footer', 'nav']){
        removeChildren(document.getElementsByTagName(tagName));
    }
    for(let className of ['footer', 'ywtop', 'nav', 'header', 'con_top', 'lm', 'bdshare', 'bdshare_t', 'comment']){
        removeChildren(document.getElementsByClassName(className));
    }
    for(let id of ['bdshare', 'comment']){
        removeChildren([document.getElementById(id)]);
    }

    function clearBackgroundColor(elements){
        for(let el of elements){
            el.style.color = "#000000";
            el.style.background = "#FFFFFF";
            el.style.backgroundColor = "#FFFFFF";
            el.style.border = "0";
        }
    }
    clearBackgroundColor([document.body]);
    clearBackgroundColor(document.getElementsByTagName('div'));

} ());